<template>
  <div>
    <nuxt />
    <main-navigation v-if="showNavbar.indexOf($route.name) > -1" />
  </div>
</template>
<script>
import { mapActions } from 'vuex'
import mainNavigation from '@/components/partials/MainNavigation.vue'
import { MAIN_NAVBAR } from '@/constants/global'
export default {
  components: { mainNavigation },
  data () {
    return {
      showNavbar: MAIN_NAVBAR.showNavbar
    }
  },
  beforeMount () {
    this.getSlides({ type: 1 })
    this.getInitInfo()
    this.getUserInfo().catch((error) => {
      console.log('游客', error.message)
    })
    this.getCoinPairInfo()
  },
  methods: {
    ...mapActions({
      getSlides: 'getSlides',
      getUserInfo: 'auth/getUserInfo',
      getInitInfo: 'getInitInfo',
      getCoinPairInfo: 'market/getCoinPairInfo'
    })
  }
}
</script>
